@extends('backend.layout.content')
@section('nav')
    <div class="col-lg-10">
        <h3>Basic Form</h3>
        <ol class="breadcrumb">
            <li>
                <a href="index.html">主页</a>
            </li>
            <li>
                <a>管理员模块</a>
            </li>
            <li class="active">
                <strong>修改管理员</strong>
            </li>
        </ol>
    </div>
@endsection
@section('content')
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <form class="form-horizontal m-t" id="commentForm" method="post" action="/{{admin_prefix()}}/users/{{$adminUser->id}}">
                {{csrf_field()}}
                {{method_field('PUT')}}
                <div class="form-group">
                    <label class="col-sm-3 control-label">用户名：</label>
                    <div class="col-sm-8">
                        <input   name="username" value="{{$adminUser->username}}" placeholder="用户名" type="text" maxlength="10" class="form-control" required="" aria-required="true">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">密码：</label>
                    <div class="col-sm-8">
                        <input  type="password" name="password" placeholder="密码" class="form-control" >
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">确认密码：</label>
                    <div class="col-sm-8">
                        <input  type="password" name="password_confirmation" placeholder="确认密码" class="form-control" >
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">角色：</label>
                    <div class="col-sm-4">
                        <select class="form-control m-b" name="rolename">
                            @if($myrole->isEmpty())
                                <option value="">请选择角色..</option>
                            @endif
                            @foreach($roles as $role)
                                 <option value="{{$role->id}}" {{$myrole->contains('name',$role->name)?'selected':''}}> {{$role->name}}({{$role->description}})</option>
                            @endforeach
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">说明：</label>
                    <div class="col-sm-8">
                        <textarea id="ccomment" name="comment" class="form-control" ></textarea>
                    </div>
                </div>
                <div class="form-group text-right">
                    <div class="col-sm-4 col-sm-offset-3">
                        <a href="javascript:history.go(-1)" class="btn btn-sm btn-info"><i class="fa fa-reply"></i> 返回</a>
\                       <button class="btn btn-primary" type="submit"><i class="fa fa-check"></i>提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
@endsection
@section('js')
    <script src="/backend/js/plugins/validate/jquery.validate.min.js"></script>
    <script src="/backend/js/plugins/validate/messages_zh.min.js"></script>
    {{--<script src="/backend/js/admin/user/form-validate.js"></script>--}}
    @include('backend.layout.error')
@endsection